package com.mvc.user.action;

import javax.servlet.http.HttpServletRequest;

import com.mvc.anocation.Action;
import com.mvc.anocation.Mapping;
import com.mvc.user.form.RegForm;

@Action("regAction")
public class RegAction {

	@Mapping("reg")
	public String reg(HttpServletRequest request, RegForm regForm) {
		if (regForm.getUserpwd1().equals(regForm.getUserpwd2())) {
			request.setAttribute("success", "注册成功！");
			return "/success.jsp";
		} else {
			request.setAttribute("error", "注册失败！两次密码不一致！");
			return "/error.jsp";
		}
	}

}
